<?php

/**
 * Action form base class.
 *
 * @method Action getObject() Returns the current form's model object
 *
 * @package    kc_report_proto
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseActionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'act_id'            => new sfWidgetFormInputHidden(),
      'prj_id'            => new sfWidgetFormInputText(),
      'act_num'           => new sfWidgetFormInputText(),
      'act_libelle'       => new sfWidgetFormInputText(),
      'act_categorie'     => new sfWidgetFormInputText(),
      'act_type'          => new sfWidgetFormInputText(),
      'act_date_emission' => new sfWidgetFormDateTime(),
      'act_date_echeance' => new sfWidgetFormDateTime(),
      'act_etat'          => new sfWidgetFormInputText(),
      'act_commentaire'   => new sfWidgetFormInputText(),
      'act_acteur'        => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'act_id'            => new sfValidatorChoice(array('choices' => array($this->getObject()->get('act_id')), 'empty_value' => $this->getObject()->get('act_id'), 'required' => false)),
      'prj_id'            => new sfValidatorInteger(),
      'act_num'           => new sfValidatorInteger(array('required' => false)),
      'act_libelle'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'act_categorie'     => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'act_type'          => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'act_date_emission' => new sfValidatorDateTime(array('required' => false)),
      'act_date_echeance' => new sfValidatorDateTime(array('required' => false)),
      'act_etat'          => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'act_commentaire'   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'act_acteur'        => new sfValidatorString(array('max_length' => 128, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('action[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Action';
  }

}
